<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .nav {
            width: 304px;
            border: 1px solid #000;
            border-radius: 5px;
            margin: 100px auto;
            box-sizing: border-box;
        }

        .nav>li {
            list-style: none;
            width: 100%;
            line-height: 36px;
            border-bottom: 1px solid #000;
            box-sizing: border-box;
            font-size: 16px;
            text-indent: 2em;
            position: relative;
        }

        .nav>li:last-child {
            border-bottom: none;
        }

        .nav>li>span {
            background: url('./images/arrow_right.png') no-repeat center;
            position: absolute;
            top: 5px;
            right: 10px;
            width: 32px;
            height: 32px;
        }

        .sub {
            display: none;
        }

        .sub>li {
            list-style: none;
            background-color: #8f3de6;
            border-bottom: 1px solid #fff;
        }

        .sub>li:last-child {
            border-bottom: none;
        }

        .sub>li:hover {
            background-color: red;
        }

        .current {
            transform: rotate(90deg);
        }
    </style>
    <script src="./../jquery-1.12.4.js"></script>
    <script>
        $(function () {
            $('.nav>li').click(function () {
                $(this).children('.sub').slideDown(1000);
                $(this).children('span').addClass('current');
                $(this).siblings().children('.sub').slideUp(1000);
                $(this).siblings().children('span').removeClass('current');
            });
        })
    </script>
</head>

<body>
    <ul class="nav">
        <li>
            一级菜单<span></span>
            <ul class="sub">
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
            </ul>
        </li>
        <li>
            一级菜单<span></span>
            <ul class="sub">
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
            </ul>
        </li>
        <li>
            一级菜单<span></span>
            <ul class="sub">
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
            </ul>
        </li>
        <li>
            一级菜单<span></span>
            <ul class="sub">
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
            </ul>
        </li>
        <li>
            一级菜单<span></span>
            <ul class="sub">
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
            </ul>
        </li>
        <li>
            一级菜单<span></span>
            <ul class="sub">
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
            </ul>
        </li>
        <li>
            一级菜单<span></span>
            <ul class="sub">
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
            </ul>
        </li>
        <li>
            一级菜单<span></span>
            <ul class="sub">
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
            </ul>
        </li>
    </ul>
</body>

</html>